// 保存召唤兽赐福   {"技能":["火属性吸收","雷属性吸收","防御","法术抵抗"],"锁定":["火属性吸收","雷属性吸收"],"bb":1,"认证码":"24_1753461117068"}
// @ts-ignore
export async function execute(client_id, message_json) {
    let characters = G.Characters.get_current_login_characters(client_id);
    let pet_index = message_json["bb"] - 1;
    let pet_data = characters["召唤兽"][pet_index];
    if (pet_data === undefined) {
        ClientUtils.send_basic_prompt(client_id, "召唤兽不存在");
        return;
    }
    if(!pet_data["赐福"]){
        ClientUtils.send_basic_prompt(client_id, "#R非法操作");
        return;
    }
    pet_data["丸子技能"] = [];
    // 从缓存取
    for (let index = 0; index < pet_data["赐福"].length; index++) {
        let skill_name = pet_data["赐福"][index];
        pet_data["丸子技能"].push({ "有此技能": pet_data["技能"].includes(skill_name), "生效": true, "名称": skill_name });
    }
    pet_data["赐福"] = undefined;
    ClientUtils.send_basic_prompt(client_id, `保存赐福技能#R/${pet_data["赐福"].join("、")}#Y/成功`)
    // 刷新召唤兽列表
    ClientUtils.send_client_message(client_id, 16, characters["召唤兽"]);
    // 刷新赐福窗口
    ClientUtils.send_client_message(client_id, 383);
}